package guiElements;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;

import javax.swing.JCheckBox;
import javax.swing.JPanel;

public class PatternSelector extends JPanel {

	private String patternName;
	private JCheckBox patternCheckBox;

	public PatternSelector(String patternName) {
		this.patternName = patternName;
		this.setLayout(null);
		setBackground(Color.white);
		this.setSize(new Dimension(150, 25));
		patternCheckBox = new JCheckBox(patternName);
		patternCheckBox.setBackground(Color.white);
		patternCheckBox.setFont(new Font("Georgia", Font.PLAIN, 16));
		patternCheckBox.setSize(new Dimension(150, 25));
		patternCheckBox.setLocation(new Point(0, 0));
		this.add(patternCheckBox);
	}

	public String patternSelected() {
		if (patternCheckBox.isSelected()) {
			return patternName;
		} else {
			return null;
		}
	}

	public String getPatternName() {
		return patternName;
	}

	public void setPatternName(String patternName) {
		this.patternName = patternName;
	}

	public JCheckBox getPatternCheckBox() {
		return patternCheckBox;
	}

	public void setPatternCheckBox(JCheckBox patternCheckBox) {
		this.patternCheckBox = patternCheckBox;
	}

}
